package com.HQCourse.order.order.controller;



import com.HQCourse.order.order.service.OrderInfoService;
import com.HQCourse.result.Result;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.HQCourse.model.order.OrderInfo;
import com.example.HQCourse.vo.order.OrderInfoQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 订单表 订单表 前端控制器
 * </p>
 *
 * @author zww
 * @since 2023-07-02
 */
@Api(tags = "订单接口")
@RestController
@RequestMapping("/admin/order/orderInfo")
public class OrderInfoController {
  @Autowired
  private OrderInfoService orderInfoService;
  @ApiOperation("分页查询")
  @GetMapping("{page}/{limit}")
    public Result listOrder(@PathVariable Long page,
                            @PathVariable Long limit,
                            OrderInfoQueryVo orderInfo){
      Page<OrderInfo> objectPage = new Page<>(page,limit);
      Map<String,Object> maps=orderInfoService.selectOrderInfdPage(objectPage,orderInfo);
      return Result.ok(maps);
  }
}

